package com.bigdata.model;

import java.util.List;
import java.util.Map;

/**
 * 分页bean
 *
 * @author redesthorse
 */
public class PageBean<T> {
    private Long total; // 总记录数
    private Integer rows; // 每页的条数
    private Integer page; // 当前页号
    private List<T> list;
    private String retmsg = "OK";
    private Integer qtime;
    private Map<String, Map<String, List<String>>> hightlight;

    public int getTotalPage() {
        if (total == 0) {
            return 0;
        } else {
            return (int) (total % rows == 0 ? total / rows : (total / rows) + 1);
        }
    }

    public Integer getQtime() {
        return qtime;
    }

    public void setQtime(Integer qtime) {
        this.qtime = qtime;
    }

    public Long getTotal() {
        return total;
    }

    public void setTotal(Long total) {
        this.total = total;
    }

    public Integer getRows() {
        return rows;
    }

    public void setRows(Integer rows) {
        this.rows = rows;
    }

    public Integer getPage() {
        return page;
    }

    public void setPage(Integer page) {
        this.page = page;
    }

    public List<T> getList() {
        return list;
    }

    public void setList(List<T> list) {
        this.list = list;
    }

    public String getRetmsg() {
        return retmsg;
    }

    public void setRetmsg(String retmsg) {
        this.retmsg = retmsg;
    }

    public Map<String, Map<String, List<String>>> getHightlight() {
        return hightlight;
    }

    public void setHightlight(Map<String, Map<String, List<String>>> hightlight) {
        this.hightlight = hightlight;
    }
}
